<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script>
    var fruits=prompt('请输入您需要查询的水果');
    switch (fruits) {
        case '菠萝':
            alert('菠萝10/斤');
            break;
        case '西瓜':
            alert('西瓜15/斤');
            break;
        case '苹果':
            alert('苹果8/斤');
            break;
        default:
            alert('暂时无这类水果');
    }
</script>
<body>

</body>
</html>